# -*- coding: utf-8 -*-
import scrapy
from scrapy.loader import ItemLoader

from zhihu_longin.items import JobblotItemLoader


class JobblogSpider(scrapy.Spider):
    name = 'jobblog'
    allowed_domains = ['jobbole.com']
    start_urls = ['http://blog.jobbole.com/113826/']

    def parse(self, response):
        l = ItemLoader(item=JobblotItemLoader(), response=response)
        l.add_css('name', '#breadcrumb .entry-header h1')
        l.add_css('content', '#breadcrumb .entry')
        return l.load_item()
